<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/all.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：岗位详情页面
    时间：2019-03-01
-->





<!----------岗位详情页面---------->
<div id="jobShowPage"><!--此ID页面切换用-->

    <div id="jobShowDetail">
        <table>
            <tr>
                <td width="60">
                    <span id="head"></span>
                    <!--<img src="../../images/toux01.png" width="40">-->
                </td>
                <td class="head_right">
                    <p class="p"><span class="t">联系人：</span>
                        <span id="contact"></span>
                        <!--陈某某-->
                    </p>
                    <p class="p"><span class="t">招聘工种：</span>
                        <span id="jobName"></span>
                        <!--工艺-->
                    </p>
                    <p class="p"><span class="t">招聘性别：</span>
                        <span id="sexName"></span>
                        <!--女-->
                    </p>
                    <p class="p"><span class="t">招聘电话：</span>
                        <span id="telephone"></span>
                        <!--13505050550-->
                    </p>
                </td>
            </tr>
        </table>
        <div style="height:10px;background:#f8f8f8;"></div>
        <div class="detail">
            <p style="border-bottom:1px solid #f8f8f8;">
                <img src="../../images/locate.png" width="8">
                所在地区
                <!--<span style="float:right;">杭州市</span>-->
                <span style="float:right;" id="address"></span>
            </p>
            <p>
                企业名称：
                <span id="company_name"></span>
                <!--120/天-->
                <br><br>
                招聘待遇：
                <span id="welfare"></span>
                <br><br>
                休班制度：
                <span id="restName"></span>
                <!--120/天-->
                <br><br>
                招聘人数：
                <span id="num"></span>
                <!--10人-->
                <br><br>
                工作年限：
                <span id="workYear"></span>
                <br><br>
                工作时间：
                <span id="workHour"></span>
                <br><br>
                年龄区间：
                <span id="ageRange"></span>
                <br><br>
                月薪：
                <span id="emolument"></span>
            </p>
            <b>岗位要求</b>
            <p>
                <!--熟悉各类网页涉及软件；有品牌涉及经验；-->
                <span id="detail"></span>
            </p>
            <b>需要技能</b>
            <p>
                <span id="skill"></span>
            </p>
            <b>公司信息</b>
            <p>
                <span id="content"></span>
            </p>
            <div class="picList" >
                <ul class="picListUl">
                </ul>
            </div>

        </div>
        <div style="height:10px;background:#f8f8f8;"></div>
        <a class="yingpin ui_button" style="display: none" onclick="getApply()">我要应聘</a>

        <a class="yingpinlist ui_button" style="display: none">投递记录</a>
        <p class="red yingpin_desc">无法投递应聘信息;应聘信息没有填写,或者没有通过审核</p>
    </div>
</div>
<input type="hidden" id="cid" value="0">
<!----------岗位页面---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<!--<script type="text/javascript" src="../../js/indexPageChange.js"></script>-->
<!--<script type="text/javascript" src="../../js/index.js"></script>-->
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/cache.js"></script>
</html>


<script type="text/javascript">
    (function(){
        H5.TitleBar.create("岗位详情");
        getShowList();
    })();

    //岗位列表
    function getShowList(){
        var jobId = getUrlParam('jobId');
        var formData = {
            app_access:app_access,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:getDomain()+'/show',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                 //   getAppErrMsg(res.msg,'',2000);
                   MC.msg.alert(res.msg,function(){
                       MC.back();
                   });
                    return;
                }
//                console.log(res.data);
                var resData = res.data;
                var head = '<img src="../../images/toux01.png" width="40">';
                if (resData.head!='') {
                    head = '<img src="'+resData.head+'" width="40">';
                }
                $('#cid')[0].value = resData.cid;
                $('#contact').html(resData.contact);
                $('#head').html(head);
                $('#jobName').text(resData.jobName);
                $('#restName').text(resData.restName);

                $('#sexName').text(resData.sexName);
                $('#telephone').text(resData.telephone);
                $('#address').text(resData.address);
                $('#welfare').text(resData.welfare);
                $('#company_name').text(resData.company_name);
                $('#num').text(resData.num);
                $('#emolument').text(resData.emolument);
                $('#workYear').text(resData.workYear);
                $('#workHour').text(resData.workHour);
                resData.ageRange=MC.API.tihuan(resData.ageRange,',','-');
                $('#ageRange').text(resData.ageRange);
                if (resData.detail) {
                    $('#detail').text(resData.detail);
                } else {
                    $('#detail').text('没有');
                }
                if (resData.skill) {
                    $('#skill').text(resData.skill);
                } else {
                    $('#skill').text('没有');
                }
                $('.qujiaoliu').attr('call',resData.cid);
                if (resData.content) {
                    $('#content').text(resData.content);
                } else {
                    $('#content').html('没有');
                }
                var info=MC.user.info;
                if(resData.cid==info.id){
                    $('.yingpinlist').show();
                    $('.yingpin').hide();
                    $('.yingpinlist').attr('href','/h5/my/job/zhaopin_yplist.html?id='+resData.id);
                }else{
                    $('.yingpinlist').hide();
                    $('.yingpin').show();
                }
                if(!resData.yunxuyingpin){
                    $('#jobShowDetail .yingpin').hide();
                    $('#jobShowDetail .yingpin_desc').show();
                }



                if(resData.status!=MC.DEL.JobsCompanysModel.status_fabuzhong&&resData.cid==info.id){
                    MC.msg.alert('请注意,该岗位不是发布中;本提示仅仅发布者可以看到');
                }
                if(resData.imgDetails&&resData.imgDetails!==''){
                    var imgDetails=JSON.parse(resData.imgDetails);
                    for(var i=0;i<imgDetails.length;i++){
                        var one=imgDetails[i];
                        var li=" <li class=\"li\">\n" +
                            "                        <img alt='"+one.name+"' src=\""+one.src+"\" class=\"pic\"/>\n" +
                            "                        <p class=\"pname\">"+one.name+"</p>\n" +
                            "                    </li>";
                        $('.picListUl').append(li);
                    }

                }

                $('#jobShowDetail #head img').attr('ziliaoid',resData.cid);

            }
        });
    }
    function getApply(){
        MC.click(function(){
            getApply_api();
        });
    }
    //去申请，工人可申请
    function getApply_api(){
        var info=MC.user.info;
        if(info.is_yingpin==0){
            MC.msg.alert('应聘信息没有填写,或者没有通过审核');
            return;
        }

        var cid = $('#cid').val();
      ///  var userInfo = cacheGet('userInfo');
        var jobId = getUrlParam('jobId');
        var formData = {
            app_access:app_access,
         ///   token:userInfo.token,
            genre:1, //1工人，2企业
            cid:cid,
            job:jobId
        };
        $.ajax({
            type:'post',
            url:'/api/home/recruit/resume-add',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code==-41) {
                    console.log(res);
                    getAppErrMsg('您的简历早已发送！','',0);
                    setTimeout(function(){
                        window.location.href = '/h5/my/job/yingpin.html';
                    },1000*2);
                    return
                } else if (res.code!=0) {
                    console.log(res);
                    getAppErrMsg(res.msg,'',0);
                    return
                }
                var resData = res.data;
                getAppErrMsg('发送成功！','',0);
                setTimeout(function(){
                    window.location.href = '/h5/my/job/yingpin.html';
                },1000*2);
            }
        });
    }
    //请求地址
    function getDomain(){
        return '/api/home/recruit';
    }
</script>